package ezonsport.android.ui.stepSystem.goalManage;


import ezonsport.android.data.DataHelper;
import ezonsport.android.service.GoalManageService;
/**
 * 计划管理
 * @author 桑成龙
 *
 */
public class GoalManageController {
	/**
	 * 定义操作的GoalManageViewModel实例
	 */
	private GoalManageViewModel goalmodel=null;
	private GoalManageService goalserVice=null;
	private DataHelper dataHelper;
	/**
	 * 构造函数
	 * @param 需要调用者传递：DataHelper实例
	 */
	public GoalManageController(DataHelper dataHelper){
		this.dataHelper=dataHelper;
		goalmodel=new GoalManageViewModel();
		goalserVice=new GoalManageService(dataHelper);
		goalmodel.setLastestGoal(goalserVice.getLatestGoal());		
	}
	/**
	 * 获取用户最新指定的运动计划
	 */
	public int getLastestGoal(){	
		return goalmodel.getLastestGoal();
	}
	/**
	 * 用于设置用户目标
	 * @param goal：用户输入的目标值
	 */
	public void setLastestGoal(int goal){   
		this.goalserVice.setLatestGoal(goal);
		goalmodel.setLastestGoal(goal);
	}
}


